const baseURL = process.env.VUE_APP_BASE_API

// 通用下载方法

export function exports(fileName, uuid) {
  window.location.href = baseURL + '/file/download?fileName=' + fileName + '&uuid=' + uuid
}

// 下载代码zip包的地址
export function downloadGeneratorZip() {
  console.log(baseURL + '/generator/download')
  window.location.href = baseURL + '/generator/download'
  console.log(baseURL + '/generator/download')
}

// 性别格式化
export function sexFormat(sex) {
  if (sex === 1) {
    return '男'
  } else {
    return '女'
  }
}

function S4() {
  return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1)
}

export function getUU_ID() {
  return (S4() + S4() + '-' + S4() + '-' + S4() + '-' + S4() + '-' + S4() + S4() + S4())
}

export function getUUID() {
  return (S4() + S4() + S4() + S4() + S4() + S4() + S4() + S4())
}
